package demo3;

public class My_Thread01 {
    public static void main(String[] args) {
        //初始化自定义线程
        MyThread01 myThread01 = new MyThread01();
        //运行这个线程
        myThread01.start();
    }
}

//自定义一个线程类，继承JDK中的Thread类
class MyThread01 extends Thread {
    @Override
    public void run() {
        while (true) {
            //可以不停的处理任务
            System.out.println("hello my thread...");
        }
    }
}